package game.particles;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Array;

public class Particle_1 extends AbsParticle {


	public Particle_1(String effectFile, String imagesDir) {
		super(effectFile, imagesDir);
	}

	public Particle_1() {
		effect = new ParticleEffect();
		effect.load(Gdx.files.internal("res/particles/particle_flower"), Gdx.files.internal("res/particles"));
        effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2 + 50);
        emitters = new Array(effect.getEmitters());
        effect.getEmitters().clear();
        effect.getEmitters().add(emitters.get(0));
        effect.start();
	}

	@Override
	public void update() {
	}

	public void action(SpriteBatch sb){
//		effect.start();
//		effect.draw(sb);
	}
	
	@Override
	public void render(SpriteBatch sb) {
		float delta = Gdx.graphics.getDeltaTime();
		effect.draw(sb, delta);
//		if (effect.isComplete())
//			effect.start();
	}
	
	
	@Override
	public void setPosition(int x, int y) {
		super.setPosition(x, y);
	}

	@Override
	public void start() {
		// TODO Auto-generated method stub
		super.start();
	}

	
}
